download-libcello:
	wget https://www.libcello.org/static/libCello-2.1.0.tar.gz

decompress-libcello:
	tar xvfh libCello-2.1.0.tar.gz

build-libcello:
	cd libCello-2.1.0; make; cd ..

build-01:
	gcc -o 01 examples/01.c -I libCello-2.1.0/include/ -L ./libCello-2.1.0 -l:libCello.a -v #v for verbose build flags output

build-01-dynamic:
	gcc -o 01 examples/01.c -I libCello-2.1.0/include/ -L ./libCello-2.1.0 -l:libCello.so -v
	patchelf --set-rpath libCello-2.1.0/ 01 # ref link: https://blog.csdn.net/juluwangriyue/article/details/108617283
	./01

build-parse-args:
	gcc -o parse_args examples/parse_args.c -I libCello-2.1.0/include/ -L ./libCello-2.1.0 -l:libCello.a -v


patchelf-print-needed-of-01:
	patchelf --print-needed 01

check-01-elf-mem-leak:
	valgrind ./01

find-files-then-etags:
	# find every .c or .h files | wc -l
	# this should do in real bash env
	etags $(find libCello-2.1.0 -type f -name *.[ch])

# emacs user do this, I am not, I just do tsoding does
deprecated-emacs-etags-setup:
	etags libCello-2.1.0/include/Cello.h
